package com.ctsi.question.dto;

import com.ctsi.commons.util.UtilDateTime;
import com.ctsi.commons.util.UtilValidate;
import com.ctsi.question.entity.NextPlanEntity;

import java.io.Serializable;

/**
 * 添加或修改下周工作计划
 */
public class AddNextPlanDTO implements Serializable {

    private String id;

    /**
     * 周报主表ID
     */
    private String reportId;

    /**
     * 工作类型
     */
    private String jobType;

    /**
     * 工作内容
     */
    private String jobContent;

    /**
     * 关键进展点
     */
    private String mainPoint;

    /**
     * 项目编号
     */
    private String projectCode;

    /**
     * 需要配合的部门
     */
    private String needDepart;

    /**
     *预期时间
     */
    private String expectComplateTime;

    public AddNextPlanDTO() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getReportId() {
        return reportId;
    }

    public void setReportId(String reportId) {
        this.reportId = reportId;
    }

    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    public String getJobContent() {
        return jobContent;
    }

    public void setJobContent(String jobContent) {
        this.jobContent = jobContent;
    }

    public String getMainPoint() {
        return mainPoint;
    }

    public void setMainPoint(String mainPoint) {
        this.mainPoint = mainPoint;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public String getNeedDepart() {
        return needDepart;
    }

    public void setNeedDepart(String needDepart) {
        this.needDepart = needDepart;
    }

    public String getExpectComplateTime() {
        return expectComplateTime;
    }

    public void setExpectComplateTime(String expectComplateTime) {
        this.expectComplateTime = expectComplateTime;
    }

    /**
     *
     * @return
     */
    public NextPlanEntity toNextPlanEntity(){
        NextPlanEntity plan = new NextPlanEntity();
        plan.setId(this.id);
        plan.setReportId(this.reportId);
        plan.setJobType(this.jobType);
        plan.setJobContent(this.jobContent);
        plan.setMainPoint(this.mainPoint);
        plan.setProjectCode(this.projectCode);
        plan.setNeedDepart(this.needDepart);
        if (UtilValidate.isNotEmpty(this.expectComplateTime)) {
            plan.setExpectComplateTime(UtilDateTime.toLong(this.expectComplateTime));
        }
        plan.setReportTime(System.currentTimeMillis());
        return plan;
    }
}
